<div class="clients index">
    <div id="filtro_busqueda" class="filtro">
        <fieldset>
            <legend>Busqueda</legend>
            <?php echo $form->create('Client', array('url' => array('controller' => 'clients', 'action' => 'index'))); ?>
            <?php
            echo $form->input('apellido', array('label' => 'Apellido'));
            echo $form->input('nombre', array('label' => 'Nombre'));
            echo $form->submit(__('Buscar', true));
            echo $form->end();
            ?>
        </fieldset>
    </div>
    <h2 class="left"><?php echo $html->image('iconos/clients.png');
__('Clientes'); ?></h2>
    <div class="actions specific">
        <ul>
            <li><?php echo $this->Html->link(__('Nuevo Cliente', true), array('action' => 'add')); ?></li>
        </ul>
    </div>
    <div class="clear"></div>
    <table cellpadding="0" cellspacing="0">
        <tr>
<!--			<th><?php echo $this->Paginator->sort('Id', 'id'); ?></th>-->
            <th><?php echo $this->Paginator->sort('Apellido', 'last_name'); ?></th>
            <th><?php echo $this->Paginator->sort('Nombre', 'first_name'); ?></th>
            <th><?php echo $this->Paginator->sort('Domicilio', 'addres'); ?></th>
            <th><?php echo $this->Paginator->sort('Teléfono', 'phone'); ?></th>
            <th><?php echo $this->Paginator->sort('Fecha de Alta', 'high_date'); ?></th>
            <th><?php echo $this->Paginator->sort('Localidad', 'locality'); ?></th>
            <th><?php echo $this->Paginator->sort('Provincia', 'province_id'); ?></th>
            <th class="actions"><?php __('Opciones'); ?></th>
        </tr>
        <?php
        $i = 0;
        foreach ($clients as $client):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
            <tr<?php echo $class; ?>>
    <!--		<td><?php echo $client['Client']['id']; ?>&nbsp;</td>-->
                <td><?php echo $client['Client']['last_name']; ?>&nbsp;</td>
                <td><?php echo $client['Client']['first_name']; ?>&nbsp;</td>
                <td><?php echo $client['Client']['addres']; ?>&nbsp;</td>
                <td><?php echo $client['Client']['phone']; ?>&nbsp;</td>
                <td><?php
            $fecha = date('d/m/Y', strtotime($client['Client']['high_date']));
            echo $fecha;
            ?>&nbsp;</td>
                <td><?php echo $client['Client']['locality']; ?>&nbsp;</td>
                <td><?php echo $client['Province']['name']; ?></td>
                <td class="actions">
                    <?php echo $this->Html->link(__('Ver', true), array('action' => 'view', $client['Client']['id'])); ?>
    <?php echo $this->Html->link(__('Editar', true), array('action' => 'edit', $client['Client']['id'])); ?>
            <?php echo $this->Html->link(__('Eliminar', true), array('action' => 'delete', $client['Client']['id']), null, sprintf(__('Esta seguro que desea eliminar el cliente # %s?', true), $client['Client']['last_name'] . ' ' . $client['Client']['first_name'])); ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
    <p>
        <?php
        echo $this->Paginator->counter(array(
            'format' => __('Página %page% de %pages%, mostrando %current% registros de %count% en total, a partir del registro %start%, terminando en el %end%', true)
        ));
        ?>	</p>

    <div class="paging">
        <?php echo $this->Paginator->prev('<< ' . __('anterior', true), array(), null, array('class' => 'disabled')); ?>
        | 	<?php echo $this->Paginator->numbers(); ?>
        |
<?php echo $this->Paginator->next(__('siguiente', true) . ' >>', array(), null, array('class' => 'disabled')); ?>
    </div>
</div>